﻿using System;
using Microsoft.BusinessData.MetadataModel;
using Microsoft.BusinessData.MetadataModel.Collections;
using Microsoft.BusinessData.Runtime;

namespace BdcRestConnector.Tests
{
    public class MyMethodInstance : IMethodInstance
    {
        private readonly MethodInstanceType _instanceType;
        private readonly INamedPropertyDictionary _properties;
        private readonly ITypeDescriptor _returnTypeDescriptor;
        private readonly IMethod _method;

        public MyMethodInstance(MethodInstanceType instanceType, INamedPropertyDictionary properties,
            ITypeDescriptor returnTypeDescriptor)
            : this(instanceType, properties, returnTypeDescriptor, null)
        {
            //~
        }

        public MyMethodInstance(MethodInstanceType instanceType, INamedPropertyDictionary properties,
            ITypeDescriptor returnTypeDescriptor, IMethod method)
        {
            _instanceType = instanceType;
            _properties = properties;
            _returnTypeDescriptor = returnTypeDescriptor;
            _method = method;
        }


        public IFilterCollection GetFilters()
        {
            throw new NotImplementedException();
        }

        public IMethod GetMethod()
        {
            return _method;
        }

        public ITypeDescriptor GetReturnTypeDescriptor()
        {
            return _returnTypeDescriptor;
        }

        public bool HasReturnTypeDescriptor
        {
            get { return _returnTypeDescriptor != null; }
        }

        public bool IsDefault
        {
            get { throw new NotImplementedException(); }
        }

        public MethodInstanceType MethodInstanceType
        {
            get { return _instanceType; }
        }

        public Microsoft.BusinessData.Infrastructure.IAccessControlList GetAccessControlList()
        {
            throw new NotImplementedException();
        }

        public bool ContainsLocalizedDisplayName()
        {
            throw new NotImplementedException();
        }

        public string GetDefaultDisplayName()
        {
            throw new NotImplementedException();
        }

        public string GetLocalizedDisplayName()
        {
            throw new NotImplementedException();
        }

        public Microsoft.BusinessData.MetadataModel.Collections.ILocalizedNameDictionary GetLocalizedNames()
        {
            throw new NotImplementedException();
        }

        public INamedPropertyDictionary GetProperties()
        {
            return _properties;
        }

        public long Id
        {
            get { throw new NotImplementedException(); }
        }

        public bool IsCached
        {
            get { throw new NotImplementedException(); }
        }

        public string Name
        {
            get { throw new NotImplementedException(); }
        }
    }
}
